import request from '@/utils/request'
// import { makeFormData, transferFormData } from "@/utils/util";

const clueApi = {
  submit: '/api/staff_extend/info/performanceList', // 绩效列表
  add: '/api/staff_extend/info/saveOrUpdatePerformance', // 新增and编辑
  info: '/api/staff_extend/info/detail', // 详情
  inquire: '/api/staff_extend/info/list_join', // 教师表格
  delete: '/api/staff_extend/info/remove', // 删除
  export: '/api/staff_extend/info/exportPerformance' // 导出
}

export function getPerformanceList (data = {}) {
  return request({
    url: clueApi.submit,
    method: 'post',
    data
  })
}

export function addPerformanceList (data = {}) {
  return request({
    url: clueApi.add,
    method: 'post',
    data
  })
}

export function infoPerformanceList (data = {}) {
  return request({
    url: clueApi.info,
    method: 'post',
    data
  })
}

export function submitTeacher (params = {}) {
  return request({
    url: clueApi.inquire,
    method: 'get',
    params
  })
}

export function deletePerformanceList (params = {}) {
  return request({
    url: clueApi.delete,
    method: 'get',
    params
  })
}

export function exportPerformanceList (params = {}) {
  return request({
    responseType: 'blob', // 重点，responseType设置为 blob
    url: clueApi.export,
    method: 'get',
    params
  })
}
